﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Sys
{
    public  class ClientForm:Form
    {


        /// <summary>
        /// 当前登陆用户的信息
        /// </summary>

        /// <summary>
        /// 登陆系统
        /// </summary>
        /// <param name="name"></param>
        /// <param name="password"></param>
        /// <returns></returns>
        public bool Login(string name, string password)
        {
            Boolean returnBool = false;
            Sys.Security.TKIdentity returnObject = (Sys.Security.TKIdentity)Sys.Security.Principal.Login(name, password);//Sys.MembershipUser.Login(name, password);
            string x=returnObject.Name;
            //returnObject.

            if (returnObject != null)
            {
                //_user = (MembershipUser)returnObject;
                //Principal= Csla.ApplicationContext.User;
                returnBool = true;
               // System.Web.HttpContext.Current.Session.Contents["AppUser"] = returnObject;
            }

            return returnBool;
        }
        
    }
}
